{% extends 'maintemplate.html' %}

{% block contents %}
{% load hakaze_filters %}
<span class="breadcrumps">
&gt; <a href="{% url hakaze.forums.views.channellist %}">Site Index</a> 
{% for p in channel.get_path %}
  &gt; <a href="{% url hakaze.forums.views.channelview p.codename %}">{{ p.name }} </a>
{% endfor %}
</span>
<br/>
<br/>

<h1>{{ channel.name.capitalize|escape }}</h1>
<blockquote>
{{ channel.description|hakazefy:"" }}<br/>
</blockquote>
{% if newthreads %}

<div class="threadlistbox">
   <h1> Threads </h1>
   <blockquote>
   <ul>
   {% for t in newthreads %}
       <li><a href="{% url hakaze.forums.views.threadview channel.codename,t.get_idinchannel %}">{{ forloop.counter }} : {{ t.title }} ({{ t.post_set.count }})</a></li>
   {% endfor %}
   </ul>
   </blockquote>
</div>

{% endif %}

<div>
    <blockquote>
    <h2>Create New Thread</h2>
    <form class="newthreadform" action="{% url hakaze.forums.views.channelview channel.codename %}" method="post">
        {% include "forums/newthreadform.html" %}
    </form>
    </blockquote>
</div>

{% if newthreads %}
   <h1> Latest Posts </h1>
   {% for t in newthreads|slice:":5" %}
       <br/>
       <div class="latestpostbox"><br/>
       <h2>Thread : <a href="{% url hakaze.forums.views.threadview channel.codename,t.get_idinchannel %}">{{ t.title }}</a></h2><br/>
       {% for post in t.getfirstpost %}
           {% include 'forums/posttemplate.html' %}
       {% endfor %}
       {% for post in t.getlatestposts_for_threadview reversed %}
           {% include 'forums/posttemplate.html' %}
       {% endfor %}
       {% if not t.is_locked %}
       <blockquote>
        <h2>Reply</h2>
        <form class="newpostform" action='{% url hakaze.forums.views.threadview channel.codename,t.get_idinchannel,"last" %}' method='post'>
            {% include "forums/newpostform.html" %}
        </form>
       </blockquote>
       {% endif %}
       </div>
    {% endfor %}
{% endif %}
<br/>
<div style="clear:both">&nbsp;</div>
{% endblock contents %}



